<?php
	include_once "config.php";

	$modname = "msb";

	$params = array(
		$modname.'.t'		=> $GLOBALS['table_view_main'],
	);
	paramsFromGet($params);

	function listTables()
	{
		global $modname;
		global $maindb;
		global $params;
		$out = "";
		$maindb->getTables();
		foreach($maindb->tables as $t)
		{
			$b = $params[$modname.'.t']==$t?" style=\"font-weight:bold;\"":"";
			$out .= "<a{$b} id=\"msb_$t\" href=\"javascript:tableChange('$t');\"
				onclick=\"changeSelectedTable(this);\">$t</a><br>\n";
		}
		return $out;
	}
	function listModules()
	{
		global $modules;
		global $g_params;
		$out = "";
		foreach($modules as $k => $m)
		{
			if($m->visible)
			{
				$b1 = $k==$g_params['m']?"<b>":"";
				$b2 = $k==$g_params['m']?"</b>":"";
				$out .= "<a href=\"?m={$k}\">$b1{$k}$b2</a><br>\n";
			}
		}
		return $out;
	}
?>
<h1>Tabelle</h1>
<?php echo listTables(); ?>
<h1>Moduli</h1>
<?php echo listModules(); ?>
<script language="javascript" type="text/javascript">
	function changeSelectedTable(o)
	{
		selectedTable.style.fontWeight = "normal";
		o.style.fontWeight="bold";
		selectedTable = o;
	}

	var selectedTable = dom_getObj('<?php echo "msb_".$params[$modname.'.t'];?>');
</script>